events {}

http {
    upstream flask_servers {
        server flask1:5001;
        server flask2:5002;
    }

    server {
        listen 5000;

        listen 443 ssl;
        server_name flask;

        ssl_certificate /etc/nginx/cert.pem;
        ssl_certificate_key /etc/nginx/key.pem;

        location / {
            proxy_pass http://flask_servers;
        }
    }
}